﻿using System;
using UnityEngine;

namespace MrPP.iot.Guide
{
    /*
    public class GuideBox : GDGeek.Singleton<GuideBox>
    {
        [SerializeField]
        private GuideDoor[] _doors;
        [SerializeField]
        private GuideTarget _target;
        [SerializeField]
        private BoxCollider _collider;
            
          
        public bool hasNext(GuideDoor door)
        {
            return true;
        }
        public GuideTarget target(GuideDoor head)
        {
            return _target;
        }
        public bool hasNext(GuideHead head)
        {  
            return true;
        }

        private bool inside(GuideHead head)
        {
            return _collider.bounds.Contains(head.getPoint().transform.position);
            
        }

        public GuidePoint next(GuideHead head)
        {
            Debug.LogError(inside(head));

            if (inside(head))
            {
                return _target;
            }
            GuidePoint door = null;
            float length = 99999f;
            foreach (var d in _doors) {
                float l = Vector3.Distance(d.getPoint().transform.position, head.getPoint().transform.position);
                if (length >= l) {
                    door = d;
                    length = l;
                }
            }
            return door;

        }
    }*/
}